<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <div>
      <van-cell-group>
        <van-field v-model="uname" label="文本" placeholder="请输入用户名" />
      </van-cell-group>
      <van-cell-group>
        <van-field v-model="uname" label="文本" placeholder="请输入用户名" />
      </van-cell-group>
    </div>
    <div>
      <HelloWorld :userList="userList" />
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import { getUserInfo } from '@/utils/apiConfigs'

export default {
  name: 'HomeView',
  components: {
    HelloWorld
  },
  data() {
    return {
      userList: [],
      uname: ""
    }
  },
  async mounted() {
    const res = await getUserInfo()
    this.userList = res.data
  },
}
</script>

<style lang="less" scoped>
.home {
  text-align: center;
}
</style>
